package com.jianggy.redis.springboot;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author jianggy
 * @version 1.0
 * @time 2018/12/19 14:18
 * @see
 **/
@Component(value = "operation")
public class RedisOperation {
    @Autowired
    private StringRedisTemplate template;
    public String getByKey(){
        String value = template.opsForValue().get("abc");
        System.out.println(value);
        return value;
    }

    public void put(){
        template.opsForValue().set("87309b0d479f4a458bf0edc8f60d50af","1234");
    }
}
